/*
 * NullCryptoEngine.h
 *
 *  Created on: Apr 11, 2011
 *      Author: Paul Woelfel
 */

#ifndef NULLCRYPTOENGINE_H_
#define NULLCRYPTOENGINE_H_

#include <string>
#include "crypto/crypto_engine.h"

class CNullCryptoEngine: public CCryptoEngine {
public:
	CNullCryptoEngine(NAudioFormats::SStreamInfo ioStreamInfo);

	virtual ~CNullCryptoEngine();

	/**
	 * abstract method encrypt
	 * encrypt pCount bytes from data and write them back to data
	 * if not enough data is available for encryption, zeros should
	 * be written to the data buffer
	 * @param data double array with amplitude values from 0 to 1
	 * @param pCount count of audio samples to work with
	 * @return 0 for success, >0 for success and discard of samples for next
	 *         call, <0 for an error
	 */
	virtual int encrypt(double *pData, unsigned int pCount);

	/**
	 * abstract method decrypt
	 * decrypt pCount bytes from data and write them back to data
	 * if not enough data is available for decryption, zeros should
	 * be written to the data buffer
	 * @param data double array with amplitude values from 0 to 1
	 * @param pCount count of audio samples to work with
	 * @return 0 for success, >0 for success and discard of samples for next
	 *         call, <0 for an error
	 */
	virtual int decrypt(double *pData, unsigned int pCount);



protected:
	/**
	 * called by the protocol engine upon settings change
	 * (e.g. change of embedding parameters)
	 * calls setProperties and initCrypto
	 * if this method gets overwritten, the subclass should call
	 * setProperties and initCrypto
	 */
	virtual int changeSettings();

	double mScale;

private:
	static const std::string sIniSectionName;


};

#endif /* NULLCRYPTOENGINE_H_ */
